<!--$Id: env_set_rpc_server.so,v 10.29 2004/08/13 03:38:57 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DB_ENV-&gt;set_rpc_server</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<b>DB_ENV-&gt;set_rpc_server</b>
</td>
<td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
</tr></table>
<hr size=1 noshade>
<tt>
<b><pre>
#include &lt;db.h&gt;
<p>
int
DB_ENV-&gt;set_rpc_server(DB_ENV *dbenv, CLIENT *client, char *host,
    long cl_timeout, long sv_timeout, u_int32_t flags);
</pre></b>
<hr size=1 noshade>
<b>Description: DB_ENV-&gt;set_rpc_server</b>
<p>Establishes a connection for this <b>dbenv</b> to a RPC server.</p>
<p>When the DB_ENV-&gt;set_rpc_server method has been called, subsequent calls
to Berkeley DB library interfaces may return or throw exceptions encapsulating
<a name="DB_NOSERVER">DB_NOSERVER</a>, <a name="DB_NOSERVER_ID">DB_NOSERVER_ID</a>, or <a name="DB_NOSERVER_HOME">DB_NOSERVER_HOME</a>.</p>
<p>The DB_ENV-&gt;set_rpc_server method configures operations performed using the specified
<a href="../api_c/env_class.html">DB_ENV</a> handle, not all operations performed on the underlying
database environment.</p>
<p>The DB_ENV-&gt;set_rpc_server method may not be called after the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is
called.
</p>
<p>The DB_ENV-&gt;set_rpc_server method
returns a non-zero error value on failure
and 0 on success.
</p>
<b>Parameters</b> <br>
 <b>cl_timeout</b><ul compact><li><a name="2"><!--meow--></a>
The <b>cl_timeout</b> parameter specifies the number of seconds the client
should wait for results to come back from the server.  Once the timeout
has expired on any communication with the server, DB_NOSERVER will
be returned.  If this value is zero, a default timeout is used.</ul>
 <b>client</b><ul compact><li>If the <b>client</b> channel has been provided by the application then
Berkeley DB will use it as its connection and the <b>host</b> and
<b>cl_timeout</b> fields are ignored.</ul>
 <b>host</b><ul compact><li>The <b>host</b> parameter is the host to which the Berkeley DB server will
connect and create a channel for communication.</ul>
 <b>flags</b><ul compact><li>The <b>flags</b> parameter is currently unused, and must be set to 0.</ul>
<a name="3"><!--meow--></a>
 <b>sv_timeout</b><ul compact><li>The <b>sv_timeout</b> parameter specifies the number of seconds the server
should allow a client connection to remain idle before assuming that the
client is gone.  Once that timeout has been reached, the server releases
all resources associated with that client connection.  Subsequent attempts
by that client to communicate with the server result in
DB_NOSERVER_ID, indicating that an invalid identifier has been
given to the server.  This value can be considered a hint to the server.
The server may alter this value based on its own policies or allowed
values.  If this value is zero, a default timeout is used.</ul>
<br>
<br><b>Errors</b>
<p>The DB_ENV-&gt;set_rpc_server method
may fail and return one of the following non-zero errors:</p>
<br>
<b>EINVAL</b><ul compact><li>An
invalid flag value or parameter was specified.</ul>
<br>
<hr size=1 noshade>
<br><b>Class</b>
<a href="../api_c/env_class.html">DB_ENV</a>
<br><b>See Also</b>
<a href="../api_c/env_list.html">Database Environments and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
